﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Business
{
    public class ChiTietHDMua
    {

        public int MaCTHDN { get; set; }
        public string MaCTHDNHienThi
        {
            get
            {
                return "CTHDN" + MaCTHDN;
            }
        }
        public int MaHDNhap { get; set; }
        public int MaHang { get; set; }
        public string MaHangHienThi
        {
            get
            {
                return "HH" + MaHang;
            }
        }
        public string TenHang { get; set; }        
        public double GiaNhap { get; set; }
        public int SoLuong { get; set; }
        public double ChietKhau { get; set; }
        public double ChietKhauHienThi
        {
            get
            {
                return ChietKhau * 100;
            }
        }


         public ChiTietHDMua(int maHDN, int maHang,
            string tenHang,  double giaNhap,int soLuong, double chietKhau)
        {
            this.MaCTHDN= 0;
            this.MaHDNhap = maHDN;
            this.MaHang = maHang;
            this.TenHang = tenHang;
            this.SoLuong = soLuong;
            this.GiaNhap = giaNhap;
            this.ChietKhau = chietKhau;
        }

         public ChiTietHDMua(int maCTHDN, int maHDNhap, int maHang,
            string tenHang, double giaNhap, int soLuong, double chietKhau)
        {
            this.MaCTHDN = maCTHDN;
            this.MaHDNhap = maHDNhap;
            this.MaHang = maHang;
            this.TenHang = tenHang;
            this.SoLuong = soLuong;
            this.GiaNhap = giaNhap;
            this.ChietKhau = chietKhau;
        }


         public void CapNhat(int maHang,
             string tenHang, double giaNhap, int soLuong, double chietKhau)
         {
             this.MaHang = maHang;
             this.TenHang = tenHang;
             this.SoLuong = soLuong;
             this.GiaNhap = giaNhap;
             this.ChietKhau = chietKhau;
         }
    }
}
